// 内部类 ===> 想一下糖葫芦的构成
// 1. 实例内部类
// 2. 静态内部类
// 3. 匿名内部类
// 4. 局部内部类

class OuterClass {
    public int data1 = 1;
    public static int data2 = 2;
    private int data3 = 3;

    class InnerClass {
        public int data4 = 4;
        //        public static int data5 = 5;
        public static final int data5 = 5;

        private int data6 = 6;

        public void test() {
            System.out.println("InnerClass::test()");
        }
    }

    public void test() {
        InnerClass innerClass = new InnerClass();
        System.out.println(innerClass.data4);
    }
}

public class Test2 {
    public static void main(String[] args) {
        OuterClass outerClass = new OuterClass();
        OuterClass.InnerClass innerClass = outerClass.new InnerClass();
        innerClass.test();

    }
}
